<!DOCTYPE html>
<title>This tests onerror event is fired if we change image src to a url blocked by content-security-policy.</title>
<meta http-equiv="Content-Security-Policy" content="img-src 'self'">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<img src="../resources/square.png"></img>
<script>
//TODO(siva.gunturi): Verify that the initial reference loads ok.
async_test(function(t) {
    var img = document.querySelector("img");
    img.onerror = t.step_func_done();
    img.src = "http://127.0.0.1:8080/resources/square.png";
});
</script>
